/*
 * Created on 28.03.2007
 *
 * To change the template for this generated file go to
 * Window&gt;Preferences&gt;Java&gt;Code Generation&gt;Code and Comments
 */
package ro.qi.framework.sys.i18n.regional.entities;

import ro.qi.framework.sys.entities.Entity;

/**
 * @author George Pogorelschi
 *
 * To change the template for this generated type comment go to
 * Window&gt;Preferences&gt;Java&gt;Code Generation&gt;Code and Comments
 */
public class CountryCollection extends Entity {

	public CountryCollection(int localeId) {
		super();
		setLocaleId(localeId);
		select();
	}

	public CountryCollection(int continentId, int localeId) {
		super();
		setLocaleId(localeId);
		setContinentId(continentId);
		select();
	}

	public void setContinentId(int value) {
		setValue("continentId",value);
	}

	public int getCollectionSize() {
		return getCollectionSize("countries");
	}

	public int getId(int index) {
		return getCollectionIntValue("countries", "id", index);
	}
	
	public Country getCountry(int index) {
		return new Country(getId(index), getLocaleId());
	}

}
